<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 | 设计感个人博客</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        :root {
            --primary: #6C63FF;
            --secondary: #FF6584;
            --dark: #2A2D3E;
            --light: #F7F9FC;
            --gray: #9A9EAE;
            --success: #4CAF50;
            --transition: all 0.3s ease;
        }

        body {
            background-color: var(--light);
            color: var(--dark);
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 导航栏样式 */
        header {
            background-color: white;
            box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 0;
        }

        .logo {
            font-size: 24px;
            font-weight: 700;
            color: var(--primary);
        }

        .nav-links {
            display: flex;
            gap: 30px;
        }

        .nav-links a {
            font-weight: 500;
            position: relative;
            transition: var(--transition);
        }

        .nav-links a:hover {
            color: var(--primary);
        }

        .nav-links a.active {
            color: var(--primary);
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -5px;
            left: 0;
            background-color: var(--primary);
            transition: var(--transition);
        }

        .nav-links a:hover::after,
        .nav-links a.active::after {
            width: 100%;
        }

        /* 登录页面主要内容 */
        .login-container {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-grow: 1;
            padding: 40px 0;
        }

        .login-card {
            background: white;
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
            padding: 50px;
            width: 100%;
            max-width: 450px;
            position: relative;
            overflow: hidden;
        }

        .login-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
        }

        .login-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .login-title {
            font-size: 2.2rem;
            font-weight: 700;
            margin-bottom: 10px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .login-subtitle {
            color: var(--gray);
            font-size: 1rem;
        }

        .form-group {
            margin-bottom: 25px;
            position: relative;
        }

        .form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: var(--dark);
        }

        .input-with-icon {
            position: relative;
        }

        .form-control {
            width: 100%;
            padding: 15px 15px 15px 45px;
            border: 1px solid #e0e0e0;
            border-radius: 10px;
            font-size: 1rem;
            transition: var(--transition);
            background: var(--light);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
        }

        .input-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }

        .form-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
        }

        .remember-me {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .checkbox {
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
        }

        .forgot-password {
            color: var(--primary);
            font-weight: 500;
            transition: var(--transition);
        }

        .forgot-password:hover {
            color: var(--secondary);
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            padding: 15px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
        }

        .btn:hover {
            background: #5a52e0;
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(108, 99, 255, 0.3);
        }

        .btn-google {
            background: white;
            color: var(--dark);
            border: 1px solid #e0e0e0;
            margin-top: 15px;
        }

        .btn-google:hover {
            background: #f5f5f5;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .divider {
            display: flex;
            align-items: center;
            margin: 30px 0;
        }

        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: #e0e0e0;
        }

        .divider-text {
            padding: 0 15px;
            color: var(--gray);
            font-size: 0.9rem;
        }

        .register-link {
            text-align: center;
            margin-top: 30px;
            color: var(--gray);
        }

        .register-link a {
            color: var(--primary);
            font-weight: 600;
            transition: var(--transition);
        }

        .register-link a:hover {
            color: var(--secondary);
        }

        .floating-shapes {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
            overflow: hidden;
        }

        .shape {
            position: absolute;
            opacity: 0.1;
            border-radius: 50%;
        }

        .shape-1 {
            width: 100px;
            height: 100px;
            background: var(--primary);
            top: -30px;
            right: -30px;
        }

        .shape-2 {
            width: 70px;
            height: 70px;
            background: var(--secondary);
            bottom: 20px;
            left: -20px;
        }

        /* 页脚样式 */
        footer {
            background: var(--dark);
            color: white;
            padding: 40px 0 20px;
            margin-top: auto;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 40px;
            margin-bottom: 40px;
        }

        .footer-column h3 {
            font-size: 1.2rem;
            margin-bottom: 20px;
            position: relative;
            padding-bottom: 10px;
        }

        .footer-column h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background: var(--primary);
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 10px;
        }

        .footer-links a {
            transition: var(--transition);
            color: rgba(255, 255, 255, 0.7);
        }

        .footer-links a:hover {
            color: white;
            padding-left: 5px;
        }

        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.9rem;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .navbar {
                flex-direction: column;
                gap: 20px;
            }
            
            .login-card {
                padding: 30px;
            }
            
            .footer-content {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 576px) {
            .nav-links {
                flex-wrap: wrap;
                justify-content: center;
            }
            
            .form-options {
                flex-direction: column;
                gap: 15px;
                align-items: flex-start;
            }
            
            .footer-content {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <header>
        <div class="container">
            <nav class="navbar">
                <a href="index.html" class="logo">DesignBlog</a>
                <div class="nav-links">
                    <a href="/index.html">首页</a>
                    <a href="articles.html">文章</a>
                    <a href="categories.html">分类</a>
                    <a href="about.html">关于</a>
                    <a href="contact.html">联系</a>
                </div>
            </nav>
        </div>
    </header>

    <!-- 登录页面主要内容 -->
    <section class="login-container">
        <div class="container">
            <div class="login-card">
                <div class="floating-shapes">
                    <div class="shape shape-1"></div>
                    <div class="shape shape-2"></div>
                </div>
                
                <div class="login-header">
                    <h1 class="login-title">欢迎回来</h1>
                    <p class="login-subtitle">登录您的账户继续探索</p>
                </div>
                <!-- 其中的的action 为后端需要处理的模块，在处理应答的时候先对这些方法进行判断，可以使用unordered_map封装成功能路由-->
                <form action="/login" method="POST"> 
                    <div class="form-group">
                        <label class="form-label" for="email">电子邮箱</label>
                        <div class="input-with-icon">
                            <i class="fas fa-envelope input-icon"></i>
                            <!-- <input type="email" id="email" class="form-control" placeholder="请输入您的电子邮箱" required> -->
                             <input type="email" id="email" name="email" class="form-control" placeholder="请输入您的电子邮箱" required>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="form-label" for="password">密码</label>
                        <div class="input-with-icon">
                            <i class="fas fa-lock input-icon"></i>
                            <!-- <input type="password" id="password" class="form-control" placeholder="请输入您的密码" required> -->
                             <input type="password" id="password" name="password" class="form-control" placeholder="请输入您的密码" required>
                        </div>
                    </div>
                    
                    <div class="form-options">
                        <div class="remember-me">
                            <input type="checkbox" id="remember" class="checkbox">
                            <label for="remember">记住我</label>
                        </div>
                        <a href="forgot-password.html" class="forgot-password">忘记密码？</a>
                    </div>
                    
                    <button type="submit" class="btn">
                        <i class="fas fa-sign-in-alt"></i>
                        登录
                    </button>
                    
                    <div class="divider">
                        <span class="divider-text">或使用以下方式登录</span>
                    </div>
                    
                    <button type="button" class="btn btn-google">
                        <i class="fab fa-google"></i>
                        使用 Google 登录
                    </button>
                    
                    <div class="register-link">
                        还没有账户？ <a href="register.html">立即注册</a>
                    </div>
                </form>
            </div>
        </div>
    </section>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-column">
                    <h3>DesignBlog</h3>
                    <p>一个专注于设计思维、创意灵感和数字美学的个人博客，分享设计旅程与见解。</p>
                </div>
                <div class="footer-column">
                    <h3>快速链接</h3>
                    <ul class="footer-links">
                        <li><a href="index.html">首页</a></li>
                        <li><a href="articles.html">文章</a></li>
                        <li><a href="categories.html">分类</a></li>
                        <li><a href="about.html">关于我</a></li>
                        <li><a href="contact.html">联系我</a></li>
                    </ul>
                </div>
                <div class="footer-column">
                    <h3>订阅更新</h3>
                    <p>订阅我的博客，获取最新的设计文章和灵感。</p>
                    <form>
                        <input type="email" placeholder="输入您的邮箱" style="padding: 10px; width: 100%; margin-top: 10px; border-radius: 5px; border: none;">
                        <button class="btn" style="margin-top: 10px; width: 100%;">订阅</button>
                    </form>
                </div>
            </div>
            <div class="copyright">
                <p>&copy; 2023 DesignBlog. 保留所有权利。</p>
            </div>
        </div>
    </footer>

    <script>
        // 登录表单交互
        document.addEventListener('DOMContentLoaded', function() {
            const loginForm = document.getElementById('loginForm');
            const emailInput = document.getElementById('email');
            const passwordInput = document.getElementById('password');
            
            // 输入框焦点效果
            const formControls = document.querySelectorAll('.form-control');
            formControls.forEach(control => {
                control.addEventListener('focus', function() {
                    this.parentElement.classList.add('focused');
                });
                
                control.addEventListener('blur', function() {
                    if (this.value === '') {
                        this.parentElement.classList.remove('focused');
                    }
                });
            });
            
            // 表单提交
            loginForm.addEventListener('submit', function(e) {
                e.preventDefault();
                
                // 简单验证
                if (!emailInput.value || !passwordInput.value) {
                    showMessage('请填写所有必填字段', 'error');
                    return;
                }
                
                // 模拟登录过程
                const submitBtn = loginForm.querySelector('.btn');
                const originalText = submitBtn.innerHTML;
                
                submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 登录中...';
                submitBtn.disabled = true;
                
                // 模拟API调用
                setTimeout(() => {
                    submitBtn.innerHTML = originalText;
                    submitBtn.disabled = false;
                    
                    // 这里应该是实际的登录逻辑
                    showMessage('登录成功！正在跳转...', 'success');
                    
                    // 模拟跳转
                    setTimeout(() => {
                        window.location.href = 'index.html';
                    }, 1500);
                }, 2000);
            });
            
            // 显示消息函数
            function showMessage(message, type) {
                // 移除现有消息
                const existingMessage = document.querySelector('.form-message');
                if (existingMessage) {
                    existingMessage.remove();
                }
                
                // 创建新消息
                const messageEl = document.createElement('div');
                messageEl.className = `form-message ${type}`;
                messageEl.textContent = message;
                messageEl.style.cssText = `
                    padding: 12px 15px;
                    border-radius: 8px;
                    margin-bottom: 20px;
                    font-weight: 500;
                    text-align: center;
                    background: ${type === 'success' ? 'rgba(76, 175, 80, 0.1)' : 'rgba(244, 67, 54, 0.1)'};
                    color: ${type === 'success' ? '#4CAF50' : '#F44336'};
                    border: 1px solid ${type === 'success' ? 'rgba(76, 175, 80, 0.2)' : 'rgba(244, 67, 54, 0.2)'};
                `;
                
                loginForm.insertBefore(messageEl, loginForm.firstChild);
                
                // 3秒后自动移除消息
                setTimeout(() => {
                    messageEl.remove();
                }, 3000);
            }
            
            // 添加一些动画效果
            const loginCard = document.querySelector('.login-card');
            loginCard.style.opacity = '0';
            loginCard.style.transform = 'translateY(20px)';
            
            setTimeout(() => {
                loginCard.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
                loginCard.style.opacity = '1';
                loginCard.style.transform = 'translateY(0)';
            }, 100);
        });
    </script>
</body>
</html>